<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // Object.assign(target,source1,source2,...);
        // target:目标对象（容器）
        // 将多个对象合并到目标对象 (数据拷贝:浅拷贝)
        let obj1 = {name:"哈哈",age:100};
        let obj2 = {sex:"男",arr:[1,2,3]};

        var resObj = Object.assign({},obj1,obj2);
        resObj.name = "测试";
        resObj.arr[0] = "哈哈";
        console.log(resObj,obj1,obj2);



        let  testObj = {name:"哈哈",age:100,sex:"男"};
        // Object.keys(object); 
        // 返回一个数组，这个数组中存放的是object的键(属性名)
        console.log(Object.keys(testObj));


        // Object.values(object);
        // 返回一个数组，这个数组中存放的是object的值(属性值)
        console.log(Object.values(testObj));


    </script>
</body>
</html>